var mongoose =require('mongoose');
mongoose.connect('mongodb://localhost/android');
var schema = mongoose.Schema;
var commentSchema = new schema({
    username:{
        type:String,
        required:true
    },
    newId:{
        type:String,
        required:true
    },
    content:{
        type:String,
        required:true
    },
    time:{
        type:String,
        required:true
    },
    author:{
        type:String,
        required:true
    },
    avatar:{
        type:String,
        required:true
    },
    nickname:{
        type:String,
        required:true
    },
    newsNickname:{
        type:String,
        required:true
    },
    newsTitle:{
        type:String,
        required:true
    },
    newsImage:{
        type:String,
        required:true
    }
});

var comment = mongoose.model('Comment',commentSchema);
module.exports = comment;